package simplevideochat.ui
{
	import mx.core.UIComponent;
	import mx.events.FlexEvent;
	import mx.events.ResizeEvent;
	import simplevideochat.application.drawingdesk.*;
	
	/**
	 * ...
	 * @author Alexey Ustinov
	 */
	public class PaintDeskComponent extends UIComponent implements IPaintingComponent
	{
		public function PaintDeskComponent() 
		{
			super();
			addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
		}
		
		private function creationCompleteHandler(e:FlexEvent):void
		{
			init();
		}
		
		public function init():void
		{
			this.graphics.clear();
			this.graphics.beginFill(0xffffff);
			this.graphics.drawRect(0, 0, this.width, this.height);
			this.graphics.endFill();
		}
		
		public function update():void
		{
			init();
		}
		
	}

}